package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.BoutRecord;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.lang.String;
import java.math.BigDecimal;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-11-01
* description:单局详情表
*/
@Data
public class BoutRecordDto extends BaseField {

    @ApiModelProperty(value = "id")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "录入记录id")
    private Long importRecordId;

    @ApiModelProperty(value = "群id")
    private Long groupId;

    @ApiModelProperty(value = "对局内容：格龙胜软x*2")
    private String txtBout;

    @ApiModelProperty(value = "赢家名称")
    private String winName;

    @ApiModelProperty(value = "输家名称")
    private String loseName;

    @ApiModelProperty(value = "赢家得分：比分，可以没有")
    private Integer winScore;

    @ApiModelProperty(value = "输家得分：比分，可以没有")
    private Integer loseScore;

    @ApiModelProperty(value = "对局类型：1:单打，2:双打，3:3v3")
    private Integer boutType;

    @ApiModelProperty(value = "奖励金币")
    private BigDecimal awardCoin;

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public BoutRecord invertEntity(){
        BoutRecord dto = new BoutRecord();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setImportRecordId(this.getImportRecordId());
        dto.setGroupId(this.getGroupId());
        dto.setTxtBout(this.getTxtBout());
        dto.setWinName(this.getWinName());
        dto.setLoseName(this.getLoseName());
        dto.setWinScore(this.getWinScore());
        dto.setLoseScore(this.getLoseScore());
        dto.setBoutType(this.getBoutType());
        dto.setAwardCoin(this.getAwardCoin());
        return dto;
    }
}
